<template>
  <div class="kill-box">
    <ul class="up">
      <li class="left">
        <span class="haigou">嗨购秒杀</span>
       <span class="node">14点到场</span>
       <van-count-down :time="time"  class="time">
       <template #default="timeData">
        <span class="block">{{ timeData.hours }}</span>
        <span class="colon">:</span>
        <span class="block">{{ timeData.minutes }}</span>
        <span class="colon">:</span>
        <span class="block">{{ timeData.seconds }}</span>
      </template>
    </van-count-down>
    </li>
    <li>
      <span class="fanqie">暴翻农场番茄</span>
    </li>
    </ul>
    <ul class="down">
      <li v-for = " item in production" :key = "item.proid" @click = "detail(item.proid)">
        <img :src="item.img1" >
        <p class="price">￥{{item.originprice}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from '@/Utils/server'
export default {
   name:"SecondKill-vue",
   data(){
    return {
      production:[],
      time: 3600000,
    }
   },
   created(){
    axios.get("/api/pro/seckilllist")
    .then(product=>{
     if(product.data.code == 200){
      this.production = product.data.data
      }
    })
   },
   methods:{
    detail(val){
      this.$router.push("/DetailPage/"+val);
    }
   }
}
   
</script>

<style scoped>
 .kill-box{
    height: 6rem;
    border-radius: 1rem;
    background-color: white;
    margin-top: .15rem;
    margin-bottom: .15rem;

 } 
.up{
  height:-0.5rem;
  background: url(../assets/title_wrap.png) ;
  background-size: 100% 2.5rem;;
  border-radius: 1rem 1rem 0px 0px;
  padding: 0;
  display: flex;
  justify-content: space-between;

 }

  .haigou{
   border-radius: 1rem 0rem 0px 0px;
   font-size: .6rem;
   box-sizing: border-box;
   padding: .25rem 2px 3px .35rem;
 }
 .node{
  font-size: .6rem;
  color: hotpink;
  padding: .25rem 2px 3px .35rem;
 }
 .colon {
    display: inline-block;
    margin: 0 4px;
    color: #ee0a24;
  }
  .block {
    display: inline-block;
    width: 18px;
    color: #fff;
    font-size: 12px;
    text-align: center;
    background-color: #ee0a24;
    border-radius: 5px;
  }
 .time{
  padding: .25rem 2px 3px .35rem;
 }
 .left{
  display: flex;
 }
 .fanqie{
  font-size: .6rem;
  color: hotpink;
  padding: .75rem .5rem 3px .35rem;
 }
 .down{
  text-align: center;
  display: flex;
  justify-content: space-around;
  margin-top: .5rem;
 }
 .down img{
    widows: 2.7rem;
    height: 2.7rem;
 }
 .price{
  font-size: .6rem;
  font-weight: 700;
  color: hotpink;
  margin-top: .25rem;
 }
</style>